package top.infopub.mgr.fia.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import top.infopub.enums.fia.ApplyModeEnum;
import top.infopub.enums.fia.ApplyTypeEnum;

import java.math.BigDecimal;
import java.util.Date;

public class FundsAppnDomain {
    /*pk*/
    private String id;
    /*项目唯一编码*/
    private String proCode;
    /*申请拨付归属项目*/
    private String proName;
    /*申请拨付类型*/
    private String applyType;
    /*创建时间*/
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date addTime;
    /*申请拨付金额*/
    private BigDecimal applyAmount;
    /*实际拨付金额*/
    private BigDecimal actualAmt;
    /*拨付方式*/
    private String applyMode;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProCode() {
        return proCode;
    }

    public void setProCode(String proCode) {
        this.proCode = proCode;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public String getApplyType() {
        return applyType;
    }

    public void setApplyType(String applyType) {
        this.applyType = applyType;
        if (StringUtils.isNotBlank(applyType)) {
            ApplyTypeEnum ppdt = ApplyTypeEnum.getByCode(applyType);
            if (ppdt != null) {
                setApplyType(ppdt.getName());
            }
        }
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public BigDecimal getApplyAmount() {
        return applyAmount;
    }

    public void setApplyAmount(BigDecimal applyAmount) {
        this.applyAmount = applyAmount;
    }

    public BigDecimal getActualAmt() {
        return actualAmt;
    }

    public void setActualAmt(BigDecimal actualAmt) {
        this.actualAmt = actualAmt;
    }

    public String getApplyMode() {
        return applyMode;
    }

    public void setApplyMode(String applyMode) {
        this.applyMode = applyMode;
        if (StringUtils.isNotBlank(applyMode)) {
            ApplyModeEnum ppdt = ApplyModeEnum.getByCode(applyMode);
            if (ppdt != null) {
                setApplyMode(ppdt.getName());
            }
        }
    }
}
